from appium import webdriver
import time

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '5.1.1'
desired_caps['deviceName'] = '127.0.0.1:62001'
# desired_caps['appPackage'] ='com.youba.calculate'
# desired_caps['appActivity'] ='.MainActivity'
desired_caps['noReset'] = True
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
# driver.install_app('D:\\360安全浏览器下载\\计算器 2.0.6.apk') 安装


# driver.remove_app('com.youba.calculate')  卸载

# driver.close_app()  关闭应用

# driver.is_app_installed('com.youba.calculate')  检查应用是否安装

# driver.close_app('com.youba.calculate')  启动应用

# driver.launch_app()  关闭应用
#
# driver.close_app("com.youba.calculate")  将应用置于后台
#
# driver.reset("com.youba.calculate") 应用重置